
public class ThreadDemo1 {
    private static  void  concurrency() {
        Thread t1 = new Thread(() -> {
            long a = 0;
            for (long i = 0; i < 100_0000_0000L; i++) {
                a++;
            }
        });
        Thread t2 = new Thread(() -> {
            long b = 0;
            for (long i = 0; i < 100_0000_0000L; i++) {
                b++;
            }
        });
        long start=System.currentTimeMillis();
        t1.start();
        t2.start();
        try {
            t1.join();
            t2.join();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
         long end=System.currentTimeMillis();
        System.out.println(end-start+"ms");
    }
    public static void main(String[] args) {
       concurrency();
    }
}
